/**
 * 
 */
package registnet.courseDemand;

import org.apache.torque.Torque;
import org.apache.torque.TorqueException;

/**
 * The main class for the project. It also calculates the running time of the
 * program
 * 
 * @author Dexter Ryan Carrasco
 */
public class CourseDemandMain {

	/**
	 * The main method
	 * 
	 * @param args
	 */
	public static void main(final String[] args) throws Exception {

		// initialize Torque properties
		try {
			Torque.init("Torque.properties");
		} catch (final TorqueException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}

		final long startTime = System.currentTimeMillis();

		// Student Clustering Algorithm
		// StudentClusteringAlgorithm courseDemand = new
		// StudentClusteringAlgorithm();
		// courseDemand.start();

		// Students Needing Algorithm
		final StudentsNeedingAlgorithm courseDemand = new StudentsNeedingAlgorithm();
		courseDemand.start();

		final long endTime = System.currentTimeMillis();

		final int timeElapsed = (int) (endTime - startTime) / 1000;
		final int minutes = timeElapsed / 60;
		final int seconds = timeElapsed - minutes * 60;

		// prints the running time of the program
		System.out.println("The program finished after " + minutes + " mins. "
				+ seconds + " secs.");
	}
}
